﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Automobile.service.Model;
using Automobile.service.BLL;
namespace Automobile.service.UI
{
    public partial class member_add : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void Unnamed_ServerClick(object sender, EventArgs e)
        {
            MemberCardBLL bll = new MemberCardBLL();
            MemberCard m = new MemberCard();
            m.MemberCard_Name = this.MemberCard_Name.Value;
            m.MemberCard_owner = this.MemberCard_owner.Value;
            m.MemberCard_Cnum = this.MemberCard_Cnum.Value;
            m.MemberCard_CardID = this.MemberCard_CardID.Value;
            m.MemberCard_ingeral = Convert.ToInt32(this.MemberCard_ingeral.Value);
            m.MemberCard_sphere = Convert.ToDecimal(this.MemberCard_sphere.Value);
            m.MemberCardRank_Rank = this.MemberCardRank_Rank.Value;
            m.MemberCard_State = 0;
            if (bll.AddMemberCard(m) > 0)
            {
                JournalBLL jbll = new JournalBLL();
                jbll.AddJourna_AddMemberCard(Convert.ToInt32(Session["empid"]),m);
                Response.Write("<script>alert('添加成功');parent.location.reload();parent.layer.close(parent.layer.getFrameIndex(window.name));</script>");
            }
            else
            {
                Response.Write("<script>alert('服务器忙');parent.layer.close(parent.layer.getFrameIndex(window.name));</script>");
            }
        }

       
    }
}